package com.laosg.study.base.ch3

import scala.beans.BeanProperty
import scala.io

/**
  * Created by kaimin on 5/5/2019.
  * time : 21:20
  * 属性的高级部分
  */
object ConDemon {

  def main(args: Array[String]): Unit = {

    var  p = new Person(12f)
    println(p.toString)
    var worker=new Work("123")
    val xxDogg = new Dogg("xx",12)
    println(xxDogg.getName)
  }


}
class Person(InName:String,InAge:Int){
  var name:String=""
  var age:Int= _
  var salary:Float=_
  def this(Inname:String){
    this("12",12)
    this.name=Inname
  }
  def this(InSalry:Float){
    this("12",12)
    this.salary=InSalry
  }

  override def toString: String = {
    this.name+" "+this.age+" "+this.salary
  }
}
class Work(val Inname:String){
  @BeanProperty var name:String=Inname
}
class Dogg{
  @BeanProperty var name:String=""
  @BeanProperty var age:Int=_
  def this(name:String,age:Int){
    this()
    this.name=name
    this.age

  }
}